from django.db import models

# Create your models here.
class Event(models.Model):
    name=models.CharField(max_length=50)
    limit=models.IntegerField()
    status=models.BooleanField()
    address=models.CharField(max_length=100)
    start_time=models.DateField()
    create_time=models.DateField()
    class Meta:
        db_table='event'


class Guest(models.Model):
    event=models.ForeignKey(to='Event',on_delete=models.CASCADE)
    realname=models.CharField(max_length=50)
    phone=models.CharField(max_length=50)
    email=models.EmailField()
    sign=models.BooleanField()
    create_time=models.DateField()
    class Meta:
        unique_together=('event','phone')
        db_table='guest'
